package com.easonji.common.constant.enums;

/**
 * @ClassName: IsMenuEnum
 * @Description: 是否是菜单的枚举
 * @Author: LiuJun
 * @date: 2018/07/08 18:04
 * @Version: 1.0
 * @Copyright: Copyright (c) 2018 - 2019
 */
public enum IsMenuEnum {
    /**
     * 是
     */
    YES(1, "是"),
    /**
     * 不是
     */
    NO(0, "不是");

    private int code;

    private String message;

    IsMenuEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String valueOf(Integer status) {
        if (status == null) {
            return "";
        } else {
            for (IsMenuEnum s : IsMenuEnum.values()) {
                if (s.getCode() == status) {
                    return s.getMessage();
                }
            }
            return "";
        }
    }
}
